<html>
<head><meta charset="utf-8"><title>when to rebuild · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/when.20to.20rebuild.html">when to rebuild</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="134746343"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/when%20to%20rebuild/near/134746343" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/when.20to.20rebuild.html#134746343">(Sep 27 2018 at 14:02)</a>:</h4>
<p><span class="user-mention" data-user-id="128294">@blitzerr</span> </p>
<p>regarding your questions:</p>
<p>Are you asking if — after fetching from upstream — <code>--keep-stage 1</code> will "still work"? The answer is unknowable; put another way, <code>--keep-stage 1</code> is <em>never</em> guaranteed to work. But it's far less likely when pulling from upstream, which has an unknown set of changes. I think that after rebasing I would recommend not using it.</p>
<p>Or you can wait and see if you get strange ICEs and errors. :P</p>



<a name="134749904"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/when%20to%20rebuild/near/134749904" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/when.20to.20rebuild.html#134749904">(Sep 27 2018 at 14:51)</a>:</h4>
<p>Yup, got a compiler panic <span class="emoji emoji-1f642" title="slight smile">:slight_smile:</span> what does ICE stand for ?</p>



<a name="134749913"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/when%20to%20rebuild/near/134749913" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/when.20to.20rebuild.html#134749913">(Sep 27 2018 at 14:51)</a>:</h4>
<p>"internal compiler error"</p>



<a name="134749964"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/when%20to%20rebuild/near/134749964" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/when.20to.20rebuild.html#134749964">(Sep 27 2018 at 14:52)</a>:</h4>
<p>Cool</p>



<a name="134750093"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/when%20to%20rebuild/near/134750093" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/when.20to.20rebuild.html#134750093">(Sep 27 2018 at 14:54)</a>:</h4>
<p>So, say I pulled from up stream, I did complete build.<br>
Then I made some changes on top. Now I can use keep stage 1 right?</p>



<a name="134750243"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/when%20to%20rebuild/near/134750243" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/when.20to.20rebuild.html#134750243">(Sep 27 2018 at 14:56)</a>:</h4>
<p>Also now when I want to compile a test file to see the effects of my latest changes, should I use </p>
<p>Rustc +stage2 &lt;file to compile&gt;? <br>
Or <br>
Rust +stage1 &lt;file&gt;</p>



<a name="134750300"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/when%20to%20rebuild/near/134750300" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/when.20to.20rebuild.html#134750300">(Sep 27 2018 at 14:57)</a>:</h4>
<p><span class="user-mention" data-user-id="128294">@blitzerr</span> that depends on what command you gave to <code>x.py</code>...</p>



<a name="134750313"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/when%20to%20rebuild/near/134750313" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/when.20to.20rebuild.html#134750313">(Sep 27 2018 at 14:57)</a>:</h4>
<p>I usually do <code>./x.py build --stage 1 -i src/libstd</code>, in which case you would run with <code>+stage1</code></p>



<a name="134750318"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/when%20to%20rebuild/near/134750318" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/when.20to.20rebuild.html#134750318">(Sep 27 2018 at 14:57)</a>:</h4>
<p>So the question is the stage 2 is the compiler with the latest changes, right ?</p>
<p>So we do rust-build with keep stage1 and then use +stage2 to see the affects of the latest changes ?</p>



<a name="134750366"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/when%20to%20rebuild/near/134750366" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/when.20to.20rebuild.html#134750366">(Sep 27 2018 at 14:58)</a>:</h4>
<p>the..huh?</p>



<a name="134750375"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/when%20to%20rebuild/near/134750375" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/when.20to.20rebuild.html#134750375">(Sep 27 2018 at 14:58)</a>:</h4>
<p>so</p>



<a name="134750384"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/when%20to%20rebuild/near/134750384" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/when.20to.20rebuild.html#134750384">(Sep 27 2018 at 14:58)</a>:</h4>
<p>first off, ignore <code>--keep-stage 1</code> entirely, it's not relevant :)</p>



<a name="134750392"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/when%20to%20rebuild/near/134750392" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/when.20to.20rebuild.html#134750392">(Sep 27 2018 at 14:58)</a>:</h4>
<p>So you only want to build libstd ?</p>



<a name="134750395"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/when%20to%20rebuild/near/134750395" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/when.20to.20rebuild.html#134750395">(Sep 27 2018 at 14:58)</a>:</h4>
<p>let's just assume you never use it</p>



<a name="134750398"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/when%20to%20rebuild/near/134750398" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/when.20to.20rebuild.html#134750398">(Sep 27 2018 at 14:58)</a>:</h4>
<p>did you read the explanation page about this?</p>



<a name="134750405"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/when%20to%20rebuild/near/134750405" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/when.20to.20rebuild.html#134750405">(Sep 27 2018 at 14:59)</a>:</h4>
<p><a href="https://rust-lang-nursery.github.io/rustc-guide/how-to-build-and-run.html" target="_blank" title="https://rust-lang-nursery.github.io/rustc-guide/how-to-build-and-run.html">https://rust-lang-nursery.github.io/rustc-guide/how-to-build-and-run.html</a></p>



<a name="134750436"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/when%20to%20rebuild/near/134750436" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/when.20to.20rebuild.html#134750436">(Sep 27 2018 at 14:59)</a>:</h4>
<p>in particular, <a href="https://rust-lang-nursery.github.io/rustc-guide/how-to-build-and-run.html#running-xpy-and-building-a-stage1-compiler" target="_blank" title="https://rust-lang-nursery.github.io/rustc-guide/how-to-build-and-run.html#running-xpy-and-building-a-stage1-compiler">this section</a>, which explains that specific command :)</p>



<a name="134750446"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/when%20to%20rebuild/near/134750446" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/when.20to.20rebuild.html#134750446">(Sep 27 2018 at 14:59)</a>:</h4>
<p>it doesn't just build libstd.. it builds <em>up to</em> libstd in stage1</p>



<a name="134750451"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/when%20to%20rebuild/near/134750451" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/when.20to.20rebuild.html#134750451">(Sep 27 2018 at 14:59)</a>:</h4>
<p>which includes building the stage1 rustc</p>



<a name="134750525"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/when%20to%20rebuild/near/134750525" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/when.20to.20rebuild.html#134750525">(Sep 27 2018 at 15:00)</a>:</h4>
<p>if you want to run the stage2 compiler, you have to build <em>up to</em> stage 2</p>



<a name="134750534"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/when%20to%20rebuild/near/134750534" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/when.20to.20rebuild.html#134750534">(Sep 27 2018 at 15:00)</a>:</h4>
<p>e.g., <code>./x.py build --stage 2 src/libstd</code></p>



<a name="134750541"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/when%20to%20rebuild/near/134750541" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/when.20to.20rebuild.html#134750541">(Sep 27 2018 at 15:00)</a>:</h4>
<p>but normally that doesn't gain you much and just takes more time</p>



<a name="134750839"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/when%20to%20rebuild/near/134750839" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/when.20to.20rebuild.html#134750839">(Sep 27 2018 at 15:04)</a>:</h4>
<p>Okay, I see. We never need to build the stage2.</p>



<a name="134750991"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/when%20to%20rebuild/near/134750991" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/when.20to.20rebuild.html#134750991">(Sep 27 2018 at 15:07)</a>:</h4>
<p>Is this doc recently updated ? It's very clear now.</p>



<a name="134751057"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/when%20to%20rebuild/near/134751057" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/when.20to.20rebuild.html#134751057">(Sep 27 2018 at 15:08)</a>:</h4>
<p>I did revise recently, not sure just when</p>



<a name="134751923"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/when%20to%20rebuild/near/134751923" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/when.20to.20rebuild.html#134751923">(Sep 27 2018 at 15:21)</a>:</h4>
<p>rustup toolchain link stage1 build/&lt;host-triple&gt;/stage1</p>



<a name="134751948"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/when%20to%20rebuild/near/134751948" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/when.20to.20rebuild.html#134751948">(Sep 27 2018 at 15:21)</a>:</h4>
<p>That's need to be done just once, or after every build ?</p>



<a name="134752287"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/when%20to%20rebuild/near/134752287" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/when.20to.20rebuild.html#134752287">(Sep 27 2018 at 15:25)</a>:</h4>
<p>just once</p>



<a name="134752704"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/when%20to%20rebuild/near/134752704" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/when.20to.20rebuild.html#134752704">(Sep 27 2018 at 15:31)</a>:</h4>
<p>thanks <span class="user-mention" data-user-id="121053">@varkor</span></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>